home *** CD-ROM | disk | FTP | other *** search
/ Super PC 35 / Super PC 35 (Shareware).iso / spc / WIN95 / CM95 / INTERNET.DLL / TEXT / WILEUDORA < prev    next >
Encoding:
Text File  |  1996-03-20  |  1.9 KB  |  106 lines

  1. IntControl (35, 500, 0, 0, 0)
  2. bOK = @TRUE
  3. szDial     = "<dialupname>"
  4. szPgmPath  = "<pgmpath>"
  5. szPgmDir   = "<pgmdir>"
  6. bGetMail   = <getmail>
  7. bSendMail  = <sendmail>
  8. bEmpty     = <empty>
  9. bCompact   = <compact>
  10. szErrDesc  = ""
  11.  
  12.  
  13. ;Dial our host (unless user is on a direct connect)...
  14. hConn = 0
  15. if ((bGetMail || bSendMail) && szDial <> "")
  16.     hConn = SDialUp (szDial)
  17.     if (!hConn)
  18.         nErr = SGetLastErr ()
  19.         switch nErr
  20.             case @SErrNotFound
  21.             szErrDesc = "Couldn't connect to %szDial% - no such dial-up"
  22.  
  23.             case nErr ; <--default
  24.             szErrDesc = "Couldn't connect to %szDial% - error %nErr%"
  25.         endswitch
  26.         bOK = @FALSE
  27.         goto LogIt
  28.     endif
  29. endif
  30.  
  31.  
  32. ;Activate or Run Eudora...
  33. If WinExist("Eudora")
  34.     WinActivate("Eudora")
  35. else
  36.     DirChange (szPgmDir)
  37.     Run(szPgmPath, "")
  38. endif
  39.  
  40.  
  41. ; Do stuff online...
  42. :GetMail
  43. if bGetMail
  44.     SendKeysTo("Eudora", "!FM")
  45.     while !WinExist("No New Mail") && !WinExist("New Mail!")
  46.         Delay(5)
  47.     endwhile
  48.     Delay(1)
  49.     SendKeysTo("Eudora", "~")
  50. endif
  51.  
  52.  
  53. :SendMail
  54. if bSendMail
  55.     SendKeysTo("Eudora", "!FQ")
  56.     while WinExist("Progress")
  57.         Delay(5)
  58.     endwhile
  59.     Delay(1)
  60. endif
  61.  
  62.  
  63. ; Do stuff offline...
  64. :Compact
  65. if bCompact
  66.     SendKeysTo("Eudora", "!ST")
  67.     while WinExist("Progress")
  68.         Delay(5)
  69.     endwhile
  70.     Delay(1)
  71. endif
  72.  
  73.  
  74. :Empty
  75. if bEmpty
  76.     SendKeysTo("Eudora", "!SE")
  77.     while WinExist("Progress")
  78.         Delay(5)
  79.     endwhile
  80.     Delay(1)
  81. endif
  82.  
  83.  
  84. ; If user hit Ctrl+Break, WIL will bring us here...
  85. :Cancel
  86.  
  87. ; Hang up...
  88. :HangUp
  89. if (hConn)
  90.     nRet = SHangUp (hConn)
  91. endif
  92.  
  93.  
  94. ; Log what we did...
  95. :LogIt
  96. if bOK == @TRUE
  97.     szLog = "Ran Eudora"
  98. else
  99.     szLog = strcat ("Error automating Eudora:", @CRLF, szErrDesc)
  100. endif
  101.  
  102. CMLogMessage (szLog)
  103. exit
  104.  
  105. ~
  106.